<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>剧集增加</title>
<link rel="stylesheet" type="text/css"	href="../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../static/js/index.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
	int f_ssc_contentid = 0;
	String para = request.getParameter("f_ssc_contentid");
	if(para != null)
		f_ssc_contentid = Integer.valueOf(para);
	String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
$(function(){
	$("#f_ssc_contentid").val(<%=f_ssc_contentid%>);
});
	$(function() {
		$("#contentForm").validate({
			rules: {
				f_ssc_name: {
					required: true,
					minlength: 1,
					maxlength: 50,
				},
				f_ssc_viewindex: {
					required: true,
					minlength: 1,
					maxlength: 50,
					digits: true
				},
				f_ssc_code: {
					required: true,
					minlength: 1,
					maxlength: 100,
				}
			},
			messages: {
				f_ssc_name: {
					required: "请输入剧集名称",
					minlength: "剧集名称不能少于1位",
					maxlength: "剧集名称不能超过50位",
				},
				f_ssc_viewindex: {
					required: "请输入剧集排序值",
					minlength: "排序值不能少于1位",
					maxlength: "排序值不能超过50位",
					digits: "只能为数字"
				},
				f_ssc_code: {
					required: "请输入视频code",
					minlength: "视频code不能少于1位",
					maxlength: "视频code不能超过100位",
				}
			},
			
		});
	});

	function _submitFm() {
		if(document.getElementById("isfree").checked){
			document.getElementById("f_ssc_isfree").value = 1;
		}
		arrayToJson();
	  if($("#contentForm").validate().form()) {
		app_ajax('insert_series.do', $("#contentForm").serialize(), function(data) {
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
		});
	  }
	}
	
</script>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：剧集管理 &gt; 剧集新增</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input id="f_ssc_contentid" type="hidden" name="f_ssc_contentid" value=""/>
					<input type="hidden" id="f_ssc_isfree" name="f_ssc_isfree" value="0"/>
					<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
					<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
					<legend>剧集新增</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										<span class="red">* </span>剧集名称:
										<input id="f_ssc_name" name="f_ssc_name" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_name_tip" class="tip">
									</td>
									<td width="10%" align="left">
										剧集描述:
										<input id="f_ssc_desc" name="f_ssc_desc" style="width: 150px;" value="" class="yl_inp yw_name" />
									</td>
								</tr>
							</table>
						</div>
					</fieldset>

					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										<span class="red">* </span>剧集状态:
										<select id="f_ssc_status" name="f_ssc_status" style="width: 150px;">
											<option value="1">有效</option>
											<option value="2">无效</option>
											<option value="4">有效但不可播</option>
										</select>
									</td>
									<td width="10%" align="left">
									<span class="red">*</span>
										排序值:
										<input id="f_ssc_viewindex" name="f_ssc_viewindex" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_viewindex_tip" class="tip">
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="50%" align="left">
									<span class="red">*</span>
										视频code:
										<input id="f_ssc_code" name="f_ssc_code" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_code_tip" class="tip">
									</td>
									<td width="50%" align="left">
										　是否免费:
										<input id="isfree" name="isfree" type="checkbox" style="width: 18px; height: 18px; line-height: 18px; border: #AEAEAC solid 1px; vertical-align: middle;"/>免费
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										<spring:message code="series_obligate1"/>:
										<input id="f_ssc_obligate1" name="f_ssc_obligate1" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_obligate1" class="tip">
									</td>
									<td width="10%" align="left">
										<spring:message code="series_obligate2"/>:
										<input id="f_ssc_obligate2" name="f_ssc_obligate2" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_obligate2" class="tip">
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
						<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										播放code_hw:
										<input id="f_ssc_mediacode" name="f_ssc_mediacode" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_ssc_mediacode_tip" class="tip">
									</td>
									<td width="10%" align="left">
										
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="40%" align="right">
										<jsp:include page="../pictures/pictures_add.jsp" flush="true">
											<jsp:param value="剧集" name="picType"/>
										</jsp:include>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
				</form>
			</div>
			<div class="toolbar" style="text-align: center;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
					href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
					href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
					class="easyui-linkbutton"
					onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
			</div>
		</div>
		<!--主体 结束-->
	</div>
</html>
